
<#include "*/general/header.ftl">

<h3>${product.name}</h3>

<img align="right" class="productImage" src="http://cs.uga.edu/~haseeb/carrello/${product.product_id}.jpg" />

<table class="supa" cellspacing="0" >
<thead>
  <th scope="col" class="nobg empty fright">
    <#if sessionIsLoggedIn == true && sessionRole == "admin">
        <form name="input" action="deleteproduct.action?productid=${product.product_id}" method="post">
            <input type="submit" value="Delete" onClick="Submit" />
        </form>
    </#if>
  </th>
  <th scope="col" class="nobg empty fright">
    <#if sessionIsLoggedIn == true && sessionRole == "admin">
        <form name="input" action="updateproduct.action?productid=${product.product_id}" method="post">
            <input type="submit" value="Update" onClick="Submit" />
        </form>
    </#if>
  </th>
</thead>
<tr>
  <th scope="row" class="spec">Description: </th>
  <td>${product.description} </td>
</tr>
<tr>
  <th scope="row" class="spec">Manufacturer:</th>
  <td>${product.manufacturer}</td>
</tr>
<tr>
  <th scope="row" class="spec">Price:</th>
  <td>$${product.price} (USD)</td>
</tr>
<#if (productExtraInfo[0]??)>
<#list 0..numOfExtraInfo - 1 as i>
<tr>
    <th scope="row" class="specalt">${productExtraInfo[i][0]!""}:</th>
    <td class="alt">${productExtraInfo[i][1]!""}</td>
</tr>
</#list>
</#if>

<#if product.quantity &gt; 0 >
    <tr>
        <td class="bottom">In Stock. Order now!</td>
        <td class="bottom fright">
            <#if sessionIsLoggedIn == true && product.quantity &gt; 0>
                <form action="viewproduct.action" method ="post">
                    <input type ="hidden" name = "productid" value ="${productid}"/>
                    <input type ="hidden" name = "save" value ="0"/>
                    <input type="submit" value="Add To Cart" onClick="Submit" />
                </form>
            </#if>
        </td>
    </tr>
<#else>
    <tr>
        <td class="bottom fright" colspan="2">Out of stock. Check back later</td>
    </tr>
</#if>

</table>

<#if relatedProducts?? >
<h4> You may also be interested in ... </h4>
<ul>
    <#list relatedProducts as p>
        <li class="supaitem"><img src = "http://uml.cs.uga.edu/~haseeb/carrello/${p.product_id}.jpg " width="75" height="75"/><div><a href="viewproduct.action?productid=${p.product_id}">${p.name} (${p.price})</a></div></li>
    </#list>
</ul>
</#if> 

<#include "*/general/footer.ftl">